package com.itheima;

import java.util.Iterator;
import java.util.LinkedHashSet;

public class LinkedHashDemo {
    public static void main(String[] args) {

        LinkedHashSet<String> set = new LinkedHashSet<>();
        set.add("zhangsan");
        set.add("lisi");
        set.add("wangwu");
        set.add("zhangsan");
        //迭代器
        Iterator<String> hash = set.iterator();
        while (hash.hasNext()) {
            String next = hash.next();
            System.out.println(next);
        }

    }
}
